PROMPT_ANSWER=""
if openstack tripleo upgrade --help | grep -qe "--yes"; then
    PROMPT_ANSWER="--yes"
fi

sudo openstack tripleo upgrade $PROMPT_ANSWER \
  --templates \
  --local-ip={{ standalone_ip }}/{{ standalone_network_prefix }} \
{% if standalone_upgrade_control_virtual_ip %}
  --control-virtual-ip={{ standalone_upgrade_control_virtual_ip }} \
{% endif %}
  -e {{ overcloud_templates_path }}/environments/standalone/standalone-tripleo.yaml \
  -r {{ overcloud_templates_path }}/roles/{{ standalone_role }} \
  -e "{{ working_dir }}/containers-prepare-parameters-upgrade.yaml" \
  -e "{{ working_dir }}/standalone_parameters_upgrade.yaml" \
{% if standalone_custom_env_files %}
  -e {{ standalone_custom_env_files | join(' -e ') }} \
{% endif %}
{% if release in ['stein', 'train', 'ussuri'] %}
  --standalone \
{% endif %}
  --output-dir {{ working_dir }}/tripleo-deploy
